package com.example.task01;

import androidx.appcompat.app.AppCompatActivity;

import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.Button;
import android.widget.Toast;

/*
    1. 当手机屏幕横向纵向转换时Activity所处于的生命周期阶段和分别执行的回调方法
    2. 当Activity运行时手机突然收到短信，打开短信界面，看完短信后返回原来的Activity, Activity所处于的生命周期阶段和分别执行的回调方法。*/
public class MainActivity extends AppCompatActivity {


    String Tag = "LifeCycle";
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        Log.d(Tag,"---onCreate---");
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
    }

    @Override
    protected void onStart() {
        Log.d(Tag,"---onStart---");
        super.onStart();
    }

    @Override
    protected void onRestart() {
        Log.d(Tag,"---onRestart---");
        super.onRestart();
    }

    @Override
    protected void onResume() {
        Log.d(Tag,"---onResume---");
        super.onResume();
    }
    @Override
    protected void onPause() {
        Log.d(Tag,"---onPause---");
        super.onPause();
    }

    @Override
    protected void onStop() {
        Log.d(Tag,"---onStop---");
        super.onStop();
    }

    @Override
    protected void onDestroy() {
        Log.d(Tag,"---onDestroy---");
        super.onDestroy();
    }
}